import request from '@/router/axios'

/*
* 欢迎语列表
* */
export function getWelcomeList(query) {
    return request({
        url: '/cp/greeting/page',
        method: 'get',
        params: query
    })
}

/*
* 欢迎语详情
* */
export function getWelcomeDetail(greetingId) {
    return request({
        url: '/cp/greeting/'+ greetingId,
        method: 'get',
        params: query
    })
}

/*
* 创建欢迎语
* */
export function addWelcome(obj) {
    return request({
        url: '/cp/greeting',
        method: 'post',
        data: obj
    })
}

/*
* 编辑欢迎语
* */
export function editWelcome(obj) {
    return request({
        url: '/cp/greeting',
        method: 'put',
        data: obj
    })
}

/*
* 删除欢迎语
* */
export function delWelcome(greetingId) {
    return request({
        url: '/cp/greeting/' + greetingId,
        method: 'delete'
    })
}

/**
 * 按type查询话术库列表
 */
 export function getMediumList(query) {
    return request({
        url: '/cp/medium/type',
        method: 'get',
        params: query
    })
}
/**
 * 查看话术库素材id
 */
 export function getSpeechcraftId(id) {
    return request({
        url: `/cp/medium/${id}`,
        method: 'get'
    })
}
/**
 * 新建话术库--欢迎语
 */
 export function postGreeting(obj) {
    return request({
        url: '/cp/medium/greeting',
        method: 'post',
        data: obj
    })
}